﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Order_OrderDetail" Codebehind="OrderDetail.aspx.cs" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../Controls/ORDERNOTEListControl.ascx" TagName="ORDERNOTEListControl"
    TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <script type="text/javascript" src="../Include/JS/Lib/jquery-1.1.4.js"></script>
    <script type="text/javascript" src="../Include/JS/calendar.js"></script>
    <script type="text/javascript" src="../Include/JS/PopupCalendar.js"></script>
    <script type="text/javascript" src="../Include/Js/OpenWindow.js"></script>
    <script type="text/javascript" src="../Include/JS/Address.js"></script>
    <script type="text/javascript">
    var  $j = jQuery.noConflict();
        var xmlhttp;
        var tranCost;
        function createRequest()
        {
            if(window.ActiveXObject)
            {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            else if(window.XMLHttpRequest)
            {
                xmlhttp = new XMLHttpRequest();
            }
       }
       function SelectOrder(path)
        {//debugger;
            var cust=document.getElementById("usercode").value; 
            var payType=document.getElementById("dlistOrderMain_ctl00_dropPayAfterReceive").value;
            var order=document.getElementById("orderCode").value;
            var retValue=window.showModalDialog(path+"DialogBoxHostFrame.aspx?url=SelectUnLockedOrderPage.aspx?param="+cust+"|"+payType+"|"+order, window,"status:off;center=yes;edge:raised;dialogHeight:525px;dialogWidth:530px;help:0;resizable:0;scrollbar=0");

            if(retValue!=""&&retValue!=undefined)
            {
              document.getElementById("hdOrder").value=retValue;  
              document.getElementById("btnMerge").click();
            }
            else
            {
                document.getElementById("hdOrder").value="";
            }
        }
       function setValue(p)
       {
            var products = p.split("|");
            var id= "";
            for(var i=0;i<products.length;i++)
            {
                if(i+1==products.length)
                {
                    var product = products[i].split(",");
                    
                    if(product.length>1)
                    {
                        id = id + product[0];
                    }
                }
                else
                {
                    var product = products[i].split(",");
                    
                    if(product.length>1)
                    {
                        id = id + product[0] + ",";
                    }
                }
            }
            document.getElementById("hidProduct").value=id;
       } 
       
       
       function CountTotal(value)
       {debugger;
           var rowCount = document.getElementById("hidOrderDetailCount").value;
           var totalQuantity = 0;
           var totalPrice = 0;
           var totalWeight = 0;
           for(var i=1;i<=rowCount;i++)
           {
                if(i<10)
                {
                    var quantityId = "dlistOrderDetail_ctl0" + i + "_txtQuantity";
                    var spriceId = "dlistOrderDetail_ctl0" + i + "_lblSprice";
                    var hidSpriceId = "dlistOrderDetail_ctl0" + i + "_hidSprice";
                    var discountId = "dlistOrderDetail_ctl0" + i + "_txtDiscount";
                    var apriceId = "dlistOrderDetail_ctl0" + i + "_lblAprice";
                    var hidApriceId = "dlistOrderDetail_ctl0" + i + "_hidAprice";
                    var samtId = "dlistOrderDetail_ctl0" + i + "_lblSamt";
                    var aamtId = "dlistOrderDetail_ctl0" + i + "_lblAamt";
                    var weightId = "dlistOrderDetail_ctl0" + i + "_lblWeight";
                    var hidWeightId = "dlistOrderDetail_ctl0" + i + "_hidWeight"; 
                    var promotionOffAmtId = "dlistOrderDetail_ctl0" + i + "_hidPromotionOffAmt";
                    var promotionIsUseCustomerDiscountId = "dlistOrderDetail_ctl0" + i + "_hidPromotionIsUseCustomerDiscount";
                    
                    var quantity = document.getElementById(quantityId);
                    var sprice = document.getElementById(spriceId);
                    var hidSprice = document.getElementById(hidSpriceId);
                    var discount = document.getElementById(discountId);
                    if(discount.value=="")//||parseFloat(discount.value)==0
                    {
                        alert("折扣不能为零或为空");
                        discount.focus();
                        return;
                    }
                    var aprice = document.getElementById(apriceId);
                    var hidAprice = document.getElementById(hidApriceId);
                    var samt = document.getElementById(samtId);
                    var aamt = document.getElementById(aamtId);
                    var weight = document.getElementById(weightId);
                    var hidWeight = document.getElementById(hidWeightId);
                    var promotionOffAmt = document.getElementById(promotionOffAmtId);
                    var promotionIsUseCustomerDiscount = document.getElementById(promotionIsUseCustomerDiscountId);
                    
                    var tempAprice =  hidSprice.value*discount.value-promotionOffAmt.value;
                    //var tempSamt = quantity.value*hidSprice.value;
                    var tempSamt = quantity.value*sprice.innerText; 
                    var tempAamt = quantity.value*tempAprice;
                    var tempWeight = quantity.value*hidWeight.value;
                    
                    hidAprice.value = tempAprice.toFixed(2);
                    aprice.innerText = tempAprice.toFixed(2);
                    samt.innerText = tempSamt.toFixed(2);
                    aamt.innerText = tempAamt.toFixed(2);
                    weight.innerText = tempWeight.toFixed(2);
                    
                    totalQuantity = totalQuantity*1.00 + quantity.value*1.00;
                    totalPrice = totalPrice*1.00 + aamt.innerText*1.00;
                    totalWeight = totalWeight*1.00 + weight.innerText*1.00;
                    
                }
                else
                {
                    var quantityId = "dlistOrderDetail_ctl" + i + "_txtQuantity";
                    var spriceId = "dlistOrderDetail_ctl" + i + "_lblSprice";
                    var hidSpriceId = "dlistOrderDetail_ctl" + i + "_hidSprice";
                    var discountId = "dlistOrderDetail_ctl" + i + "_txtDiscount";
                    var apriceId = "dlistOrderDetail_ctl" + i + "_lblAprice";
                    var hidApriceId = "dlistOrderDetail_ctl" + i + "_hidAprice";
                    var samtId = "dlistOrderDetail_ctl" + i + "_lblSamt";
                    var aamtId = "dlistOrderDetail_ctl" + i + "_lblAamt";
                    var weightId = "dlistOrderDetail_ctl" + i + "_lblWeight";
                    var hidWeightId = "dlistOrderDetail_ctl" + i + "_hidWeight";
                    var promotionOffAmtId = "dlistOrderDetail_ctl" + i + "_hidPromotionOffAmt";
                    var promotionIsUseCustomerDiscountId = "dlistOrderDetail_ctl" + i + "_hidPromotionIsUseCustomerDiscount";
                    
                    var quantity = document.getElementById(quantityId);
                    var sprice = document.getElementById(spriceId);
                    var hidSprice = document.getElementById(hidSpriceId);
                    var discount = document.getElementById(discountId);
                    if(discount.value=="")//||parseFloat(discount.value)==0
                    {
                        alert("折扣不能为零或为空");
                        discount.focus();
                        return;
                    }
                    var aprice = document.getElementById(apriceId);
                    var hidAprice = document.getElementById(hidApriceId);
                    var samt = document.getElementById(samtId);
                    var aamt = document.getElementById(aamtId);
                    var weight = document.getElementById(weightId);
                    var hidWeight = document.getElementById(hidWeightId);
                    var promotionOffAmt = document.getElementById(promotionOffAmtId);
                    var promotionIsUseCustomerDiscount = document.getElementById(promotionIsUseCustomerDiscountId);
                    
                    var tempAprice =  hidSprice.value*discount.value-promotionOffAmt.value;
                    //var tempSamt = quantity.value*hidSprice.value;
                    var tempSamt = quantity.value*sprice.innerText; 
                    var tempAamt = quantity.value*tempAprice;
                    var tempWeight = quantity.value*hidWeight.value;
                    
                    hidAprice.value = tempAprice.toFixed(2);
                    aprice.innerText = tempAprice.toFixed(2);
                    samt.innerText = tempSamt.toFixed(2);
                    aamt.innerText = tempAamt.toFixed(2);
                    weight.innerText = tempWeight.toFixed(2);
                    
                    totalQuantity = totalQuantity*1.00 + quantity.value*1.00;
                    totalPrice = totalPrice*1.00 + aamt.innerText*1.00;
                    totalWeight = totalWeight*1.00 + weight.innerText*1.00;
                    
                }
           }
           
           var orderMainQuantity = document.getElementById("dlistOrderMain_ctl00_lblQuantity");
           var orderMainAmt = document.getElementById("dlistOrderMain_ctl00_lblAmt");
           var orderMainOfferAmt = document.getElementById("dlistOrderMain_ctl00_txtOfferAmt");
           var orderMainTranCost = document.getElementById("dlistOrderMain_ctl00_txtTranCost");
           var orderMainAamt = document.getElementById("dlistOrderMain_ctl00_lblAamt");
           var orderMainWeight = document.getElementById("dlistOrderMain_ctl00_lblWeight");
           var hidCity = document.getElementById("hidCity");
           var dropTraner = document.getElementById("dlistOrderMain_ctl00_dropTraner");
           
           orderMainQuantity.innerText = totalQuantity;
           orderMainAmt.innerText = totalPrice.toFixed(2);
           orderMainWeight.innerText = totalWeight.toFixed(2);
           orderMainAamt.innerText=(totalPrice+orderMainTranCost.value*1.00-orderMainOfferAmt.value*1.00).toFixed(2);
           var tranerCode = "";
           for(var i=0;i<dropTraner.options.length;i++)
           {
               if(dropTraner.options[i].selected)
               {
                    tranerCode = dropTraner.options[i].value;
                    break;
               }
           }
           
           if(hidCity.value=="")
           {
               return;
           }           
           //debugger;
           //异步计算物流费用
           createRequest();
           xmlhttp.onreadystatechange = StateDO;
           xmlhttp.open("GET","CountTranCost.aspx?traner=" + tranerCode + "&city=" + hidCity.value + "&weight=" + totalWeight ,true);
           xmlhttp.send(null);         
           if(value!=null)
           {
              document.getElementById("hidChange").value=value;
           }
           
       }       
       
       function EditTranCostUpdateAamt()
       {
            var orderMainAmt = document.getElementById("dlistOrderMain_ctl00_lblAmt");
            var orderMainOfferAmt = document.getElementById("dlistOrderMain_ctl00_txtOfferAmt");
            var orderMainTranCost = document.getElementById("dlistOrderMain_ctl00_txtTranCost");
            var orderMainAamt = document.getElementById("dlistOrderMain_ctl00_lblAamt");
            
            var tempAamt = orderMainAmt.innerText*1.00 - orderMainOfferAmt.value*1.00 + orderMainTranCost.value*1.00;
            orderMainAamt.innerText = tempAamt.toFixed(2);
       }
       
       function StateDO()
        {           
            if(xmlhttp.readystate==4)
            {
                if(xmlhttp.status==200)
                {
                    if( xmlhttp.responseText=="false")
                    {
                        alert("系统无法查询到选定物流公司在选定地区的收费标准"); return;
                    }
                    var orderMainAmt = document.getElementById("dlistOrderMain_ctl00_lblAmt");
                    var orderMainOfferAmt = document.getElementById("dlistOrderMain_ctl00_txtOfferAmt");
                    var orderMainTranCost = document.getElementById("dlistOrderMain_ctl00_txtTranCost");
                    var orderMainAamt = document.getElementById("dlistOrderMain_ctl00_lblAamt");
                    var hidpost=document.getElementById("hidpostback"); //是否是每一次运行,如果是则不计算物流费用

                    var hidFree=document.getElementById("hidFreeWL").value;  //免运费标准0 即没有启用

                    var hidchange=document.getElementById("hidChange").value  //是否是JS修改引起的要计算物流费用
                    var tempAamt = orderMainAmt.innerText*1.00 - orderMainOfferAmt.value*1.00;
                    if(hidpost.value=="1"||hidchange!="0")  //1 不是第一次运行或者是JS修改引起的变动

                    {
                      if(hidFree*1.00>0)
                      {
                         if(tempAamt>=hidFree*1.00)
                         {
                             tranCost=0.00;
                         }
                         else
                         {
                             tranCost= xmlhttp.responseText;
                         }
                      }
                      else
                      {
                         tranCost= xmlhttp.responseText;
                      }
                    }
                    else
                    {
                      tranCost=orderMainTranCost.value;
                    }
                    
                    
                    var cost = tranCost*1.00;
                    orderMainTranCost.value = cost.toFixed(2);
                    tempAamt=tempAamt+ cost;
                    orderMainAamt.innerText = tempAamt.toFixed(2);
                    
                    document.getElementById("hidChange").value="0"; //把是否JS修改重置成0
                    var arg = orderMainAmt.innerText;
                    
                    <%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "")%>; 
                    
                }
            }
        }
        function ReceiveServerData(result)  
        {
            if(result!="")
            {
                var returnValue =result.split('|'); 
                document.getElementById("hidOrderMainDJBH").value = returnValue[1];
                
                var orderMainAmt = document.getElementById("dlistOrderMain_ctl00_lblAmt");
                var orderMainOfferAmt = document.getElementById("dlistOrderMain_ctl00_txtOfferAmt");
                var orderMainTranCost = document.getElementById("dlistOrderMain_ctl00_txtTranCost");
                var orderMainAamt = document.getElementById("dlistOrderMain_ctl00_lblAamt");
                
                var promotionAmount = returnValue[0]*1.00;
                orderMainOfferAmt.value = promotionAmount.toFixed(2);
                var tempAamt = orderMainAmt.innerText*1.00 - promotionAmount + orderMainTranCost.value*1.00;
                orderMainAamt.innerText = tempAamt.toFixed(2);
            }
            else
            {
                document.getElementById("hidOrderMainDJBH").value ="";
                
                var orderMainAmt = document.getElementById("dlistOrderMain_ctl00_lblAmt");
                var orderMainOfferAmt = document.getElementById("dlistOrderMain_ctl00_txtOfferAmt");
                var orderMainTranCost = document.getElementById("dlistOrderMain_ctl00_txtTranCost");
                var orderMainAamt = document.getElementById("dlistOrderMain_ctl00_lblAamt");
                
                var promotionAmount = 0*1.00;
                orderMainOfferAmt.value = orderMainOfferAmt.value;//promotionAmount.toFixed(2);
                var tempAamt = orderMainAmt.innerText*1.00 - orderMainOfferAmt.value*1.00 + orderMainTranCost.value*1.00;
                orderMainAamt.innerText = tempAamt.toFixed(2);
            }
        }
        
        function AddressSelect(ctl)
        {
            var addressInfo = ctl.lang.split('$');
            document.getElementById("txtReceiver").value = addressInfo[0];
            document.getElementById("txtAddress").value = addressInfo[4];
            document.getElementById("txtPostCode").value = addressInfo[5];
            //document.getElementById("txtPhone").value = addressInfo[6];
               var phonearr=addressInfo[6];
               phonearr=phonearr.split('-');
               
               if(phonearr.length==2)
               {
                    document.getElementById("txtPhone").value=phonearr[0];  
                    document.getElementById("txtPhone1").value=phonearr[1];   
                    document.getElementById("txtPhone2").value="分机";                
               }
               if(phonearr.length==3)
               {  
                    document.getElementById("txtPhone").value=phonearr[0];  
                    document.getElementById("txtPhone1").value=phonearr[1]; 
                    document.getElementById("txtPhone2").value=phonearr[2];                  
               }
            document.getElementById("txtMobile").value = addressInfo[7];
            
            var dropProvince = document.getElementById("Province");
            var dropCity = document.getElementById("City");
            var dropArea = document.getElementById("Area");
                        
            for(var i=0;i<dropProvince.options.length;i++)
            {
                if(dropProvince.options[i].value==addressInfo[1])
                {
                    dropProvince.options[i].selected = true;
                    break;
                }
            }
            
            GetCityList(addressInfo[1],addressInfo[2]);
            GetAreaList(addressInfo[2],addressInfo[3]);
                 
            document.getElementById("hidReceiveAddressInfo").value = ctl.lang;
            document.getElementById("hidCity").value = addressInfo[2];
            
            CountTotal();
        }
        
        function InitAddress()
        {
            var hidReceiveAddressInfo = document.getElementById("hidReceiveAddressInfo");
            var addressInfo = hidReceiveAddressInfo.value.split('$');
            document.getElementById("txtReceiver").value = addressInfo[0];
            document.getElementById("txtAddress").value = addressInfo[4];
            document.getElementById("txtPostCode").value = addressInfo[5];
            //document.getElementById("txtPhone").value = addressInfo[6];
               var phonearr=addressInfo[6];
               phonearr=phonearr.split('-');
               
               if(phonearr.length==2)
               {
                    document.getElementById("txtPhone").value=phonearr[0];  
                    document.getElementById("txtPhone1").value=phonearr[1];   
                    document.getElementById("txtPhone2").value="分机";                
               }
               if(phonearr.length==3)
               {  
                    document.getElementById("txtPhone").value=phonearr[0];  
                    document.getElementById("txtPhone1").value=phonearr[1]; 
                    document.getElementById("txtPhone2").value=phonearr[2];                  
               }
            document.getElementById("txtMobile").value = addressInfo[7];
            var dropProvince = document.getElementById("Province");
            var dropCity = document.getElementById("City");
            var dropArea = document.getElementById("Area");
                        
            for(var i=0;i<dropProvince.options.length;i++)
            {
                if(dropProvince.options[i].value==addressInfo[1])
                {
                    dropProvince.options[i].selected = true;
                    break;
                }
            }
            
            GetCityList(addressInfo[1],addressInfo[2]);
            GetAreaList(addressInfo[2],addressInfo[3]); 
            document.getElementById("hidCityCode").value = addressInfo[2];
            document.getElementById("hidAreaCode").value = addressInfo[3];  
        }
        
        function GetAreaListAndCountTotal(value,selectvalue)
        {   //debugger;
            LoadArea=false;
            if(parseInt(value)>-1)
            {
                $j.post("../Handler/AddressHandler.ashx", {City:value, OP:"Area"},
                        function(data){                          
                           InitArea(data,selectvalue);
                        }
                    );
             }
             else
             {
                var sel = document.getElementById("Area"); 
            
                while( sel.length>0 )
                {
                    sel.removeChild(sel.options(0));
                    
                }
                sel.options[0]=new Option("请选择","-1");
             }
             var hidCity = document.getElementById("hidCity");
             hidCity.value=value;
             if(value!="-1")
             {
                CountTotal("1");
                document.getElementById("hidCityCode").value = value;
             }
             else
             {
                document.getElementById("hidCityCode").value = "000001";
             }
             
             
        }
        
        function SetAreaCode()
        {
            var dropArea = document.getElementById("Area");
            if(dropArea.options[0].selected)
            {
                document.getElementById("hidAreaCode").value = "000001";
                return;
            }
            for(var i=0;i<dropArea.options.length;i++)
            {
                if(dropArea.options[i].selected)
                {
                    document.getElementById("hidAreaCode").value = dropArea.options[i].value;
                    break;
                }
            }
        }
        
        function SelectPromotion(ctl)
        {
            var str = ctl.id.substring(0,ctl.id.lastIndexOf("_"));
            var cntrolId = ctl.id.substring(0,ctl.id.lastIndexOf("_")) + "_lblCode";
            var productId = document.getElementById(cntrolId).innerText;
        
            var url = "SelectPromotion.aspx?code=" + productId;
            var selectedPromotion = window.showModalDialog(url, window,'status:off;center=yes;edge:raised;dialogHeight:500px;dialogWidth:750px;help:0;resizable:0;scrollbar=0');
            document.getElementById("hidSelectedPromotion").value = selectedPromotion;
        }
        
        function SelectPresent(ctl)
        {
            var str = ctl.id.substring(0,ctl.id.lastIndexOf("_"));
            var cntrolId = ctl.id.substring(0,ctl.id.lastIndexOf("_")) + "_hidPromotionId";
            var promotionId = document.getElementById(cntrolId).value;
            
            var url = "SelectPresent.aspx?code=" + promotionId;
            var selectedPromotion = window.showModalDialog(url, window,'status:off;center=yes;edge:raised;dialogHeight:500px;dialogWidth:750px;help:0;resizable:0;scrollbar=0');
            document.getElementById("hidSelectedPresent").value = selectedPromotion;
        }
        
        function CheckNeedToSave()
        {
            Mask();
            var hidIsNeedToSave = document.getElementById("hidIsNeedToSave");
            if(confirm('审核前需要保存吗?'))
            {
                hidIsNeedToSave.value="1";
            }
            else
            {
                hidIsNeedToSave.value="0";
            }
        }
        function SelectServiceStation() 
        {
            
	        var returnValue = window.showModalDialog('../BaseData/SelectServiceStation.aspx', window,'status:off;center=yes;edge:raised;dialogHeight:500px;dialogWidth:750px;help:0;resizable:0;scrollbar=0');	
            
	        if(returnValue!="")
	        {
	            var arrReturnValue = returnValue.split('|');
	            if(arrReturnValue.length=2)
	            {
	                document.getElementById("lblServiceStationId").innerText = arrReturnValue[0];
	                document.getElementById("lblServiceStationName").innerText = arrReturnValue[1];
	                document.getElementById("hidServiceStationId").value = arrReturnValue[0];
	                document.getElementById("hidServiceStationName").value = arrReturnValue[1];
	                document.getElementById("hidIsUseStationDelivery").value = "1";
	                if(document.getElementById("hidIsPayAfterReceive").value=="1")
	                {
	                    document.getElementById("chk1").checked = true;
	                }
	                else if(document.getElementById("hidIsPayAfterReceive").value=="0")
	                {
	                    document.getElementById("chk1").checked = false;
	                }
	            }
	        }
	        
        }  
        function CancelSelectServiceStation() 
        {
            document.getElementById("lblServiceStationId").innerText = "";
	        document.getElementById("lblServiceStationName").innerText = "";
	        document.getElementById("hidIsUseStationDelivery").value = "0";
	        document.getElementById("chk1").checked = false;
        }
        function InitSelectServiceStation()
        {
            if(document.getElementById("hidIsUseStationDelivery").value == "1")
            {
                document.getElementById("lblServiceStationId").innerText = document.getElementById("hidServiceStationId").value;
                document.getElementById("lblServiceStationName").innerText = document.getElementById("hidServiceStationName").value;
                if(document.getElementById("hidIsPayAfterReceive").value=="1")
                {
                    document.getElementById("chk1").checked = true;
                }
                else if(document.getElementById("hidIsPayAfterReceive").value=="0")
                {
                    document.getElementById("chk1").checked = false;
                }
            }
        }
    function QueryStock(ctl)
    {
        if(document.getElementById("hidIsOpenQueryStockWindow").value == "0")
        {
            return;
        }
        var url = '../BaseData/QueryStock.aspx?code=' + ctl.name;
        window.showModalDialog(url, window,'status:off;center=yes;edge:raised;dialogHeight:500px;dialogWidth:750px;help:0;resizable:0;scrollbar=0');
    }
    
    function ValidLocker()
    {
        if(document.getElementById("hidLocker").value == document.getElementById("hidUser").value)
        {
        
        }
        else
        {
            var info = "订单已被" + document.getElementById("hidLockerName").value + "锁定，是否要解锁?";
            if(confirm(info))
            {
                
                document.getElementById("hidIsUnlock").value="1";
            }
            else
            {
                
                document.getElementById("hidIsUnlock").value="0";
                
            }
        }
    }
    function Mask()
    {
        var div_back = document.getElementById("div_background");
        div_back.style.display = "block"; 
    }

    function HidMask()
    {
        var div_back = document.getElementById("div_background");
        div_back.style.display = "none";    
    }  
    
    function CheckConfirm()
    {
        if(document.getElementById("hdPrintFlag1").value=="1"||document.getElementById("hdPrintFlag2").value=="1")
        {
            return confirm("已经打印物流单或者配货单，是否继续执行反审核？");
        }
    }  
function CheckAddress()
{
    var reciver=document.getElementById("txtReceiver");
    if(reciver.value.length<1)
    {
        alert("收货人姓名不能为空");
        reciver.focus();
        return false;
    }
    var Province=document.getElementById("Province");
    if(Province.selectedIndex<1)
    {
        alert("请选择省份");
        Province.focus();
        return false;
    }
    var City=document.getElementById("City");
    if(City.selectedIndex<1)
    {
        alert("请选择城市");
        City.focus();
        return false;
    }
    var Area=document.getElementById("Area");
    if(Area.selectedIndex<1)
    {
        alert("请选择区县");
        Area.focus();
        return false;
    }
    var daddress=document.getElementById("txtAddress");
    if(daddress.value.length<1)
    {
        alert("请填写具体地址");
        daddress.focus();
        return false;
    }
    debugger;
    //why 09-07-01
    var post1=document.getElementById ("txtPostCode").value;
    document.getElementById ("txtPostCode").value=post1.replace(/\s/g,"");
    
    var post=document.getElementById("txtPostCode");
    if(isNaN(post.value))
    {
        alert("邮编格式错误,请检查您输入法的全角/半角状态！");
        post.focus();
        return false;
    }
    var regular=/^\d{6}$/;
    if(!regular.test(post.value))
    {
        alert("邮编不正确");
        post.focus();
        return false;
    }
    
    //why 09-07-01
    var Phone=document.getElementById("txtPhone").value;
    var Phone1=document.getElementById("txtPhone1").value;
    var Phone2=document.getElementById("txtPhone2").value;
    document.getElementById("txtPhone").value=Phone.replace(/\s/g,"");
    document.getElementById("txtPhone1").value=Phone1.replace(/\s/g,"");
    document.getElementById("txtPhone2").value=Phone2.replace(/\s/g,"");
    
    var phone=document.getElementById("txtPhone");//区号
    var phone1=document.getElementById("txtPhone1");//电话号码
    var phone2=document.getElementById("txtPhone2");//分机号码
    var mobile=document.getElementById("txtMobile");
    if((phone1.value.length==0||phone1.value=="号码")&&mobile.value.length==0)
    {alert("手机或固定电话必填一个"); return false;}
    
    if(phone.value.length>0&&phone.value!="区号"||phone1.value.length>0&&phone1.value!="号码"||phone2.value.length>0&&phone2.value!="分机")
        {
        if((phone.value.length>0&&phone.value!="区号")||(phone1.value.length>0&&phone1.value!="号码"))
        {
            if(isNaN(phone.value)||isNaN(phone1.value))
            {
                alert("固定电话格式错误,请检查您输入法的全角/半角状态！");
                return false;
            }
            var reg=/^\d{3,4}$/;//检查区号

            var reg1=/^\d{7,8}$/;//检查电话号码

            if(!reg.test(phone.value)||!reg1.test(phone1.value))
            {
                alert("固定电话格式错误");
                return false;
            }
        }
        if(phone2.value.length>0&&phone2.value!="分机")
        {
            if(isNaN(phone.value)||isNaN(phone1.value)||isNaN(phone2.value))
            {
                alert("固定电话格式错误,请检查您输入法的全角/半角状态！");
                return false;
            }
            var reg=/^\d{3,4}$/;//检查区号

            var reg1=/^\d{7,8}$/;//检查电话号码

            var reg2=/^\d{1,5}$/;//检查分机号
            if(!reg.test(phone.value)||!reg1.test(phone1.value)||!reg2.test(phone2.value))
            {
                alert("固定电话格式错误");
                return false;
            }
        }
    }
    
    //why 09-07-01
    var mobile1=document.getElementById ("txtMobile").value;
    document.getElementById ("txtMobile").value=mobile1.replace(/\s/g,"");
    
    var mobile=document.getElementById("txtMobile");
    if(mobile.value.length>0)
    {
        if(isNaN(mobile.value))
        {
            alert("手机号码含有非法字符");
            mobile.focus();
            return false;
        }
        var reg=/^\d{11}$/;//检查手机

        if(!reg.test(mobile.value))
        {
            alert("请输入正确的11位数手机号码");
            mobile.focus();
            return false;
        }
        /*
        var myreg = /^(((13[0-9]{1})|159|153)+\d{8})$/;
        var flag=myreg.test(mobile.value);
        if(!flag)
        {
            alert("手机号码格式错误");
            mobile.focus();
            return false;
        }
        */
    }
    return true;
}
function AddNewAddress()
{    
    if(CheckAddress())
    {
    debugger;
        var reciver=document.getElementById("txtReceiver").value;
        var Province=document.getElementById("Province").value;
        var City=document.getElementById("City").value;
        var Area=document.getElementById("Area").value;
        var daddress=document.getElementById("txtAddress").value;
        var post=document.getElementById("txtPostCode").value;
        
        var UserCode=document.getElementById("usercode").value;
        
        var phone0=document.getElementById("txtPhone");//区号
        var phone1=document.getElementById("txtPhone1");//电话号码
        var phone2=document.getElementById("txtPhone2");//分机号码
    
        var phone="";
        if(phone1.value.length>0&&phone1.value!="号码")
        {
            phone=phone0.value+"-"+phone1.value;            
        }
        if(phone2.value.length>0&&phone2.value!="分机")
        {
            phone=phone0.value+"-"+phone1.value+"-"+phone2.value;
        }
        var mobile=document.getElementById("txtMobile").value;
        Mask();
        //SetAddress("<br /><br />数据加载中......<br /><br /><img src='../Include/Images/loadimg.gif'>");        
        $j.post("../Handler/AddressHandler.ashx", {Reciver:reciver,Province:Province,City:City,Area:Area,Address:daddress,Post:post,Phone:phone,Mobile:mobile,UserCode:UserCode, OP:"AddBack"},
                function(data){                 
                   window.location.reload();
                }
            );
    }
}
function addZF()
{debugger;
    var ZFDetail=document.getElementById("ZFDetail");
    if(ZFDetail.rows.length<5) return;
    var sumZF=0.00;
    var num=1;
    for(var i=2;i<ZFDetail.rows.length-2;)
    {
        num++;
        sumZF+=parseFloat(ZFDetail.rows[i].cells[4].childNodes[0].value);
        i=i+2;
    }
    //alert(sumZF);
    document.getElementById("dlistPayDocPayDetail_ctl0"+num.toString()+"_c5").value=sumZF;
}
function CheckDigit(ctl,str)
{
    var reg="^[0-9]*$";
    var value=ctl.value;
    if(!value.match(reg))
    {   
        ctl.value="";
        ctl.focus();
        alert(str);
    }
}
    </script>
    <style type="text/css">
    .modalPopup {
	background-color:#ffffdd;
	border-width:3px;
	border-style:solid;
	border-color:#bdbdbd;
	padding:3px;
	width:250px;
}
.modalBackground {
	background-color:Gray;
	filter:alpha(opacity=70);
	opacity:0.7;
}
body {font-size:12px;margin:0;padding:0; color:#000000;}
.btlj {background: url(../Include/Images/bt.gif) no-repeat;color:#000000; width:52px; height:23px;text-align:center; padding-top:5px; font-size:12px;float:left;margin-left:5px;display:inline;}
.btlj a{color:#000000; text-decoration:none;}
.btlj a:hover{color:#FF3300;text-decoration:underline;}
.juli {margin-top:10px;padding-left:20px;}
.juli1 {margin-top:20px; margin-left:20px; text-align:left;}
.menu {float:left; width:100px;text-align:center;}
.menu1 {float:left; width:300px;text-align:center;}
.r_bgcolor4 {background-color:#F1F1F1; font-weight:600; text-align:center; padding-top:5px;padding-bottom:5px;border:#CCCCCC 1px solid;}
.fd1 {width:74px;margin:20px auto 0; clear:left;}
.fd2 {width:900px;margin:0 auto 0; clear:left;}
.fd3 {width:900px;margin:20px auto 0; clear:left;}
.fd4 {width:900px;margin:0 auto 20px; clear:left;}
.fd5 {width:900px;margin:-10px auto 20px; clear:left;}
.inputw{width:60px;}
.table {padding-left:20px;}
.tb3 {width: 500px; background-color:#999999;}
.tb4 {width: 1000px; background-color:#999999;}
.index {width:1049px; margin:0; padding-left:0;border-top:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 1px solid;}
.indexdh {width:1049px; height:25px; margin:0; padding:0;}
.indexthleft {background-position: center top;width:100px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.indexthleft5 {background-position: center top;width:60px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.indexthleft6 {background-position: center top;width:180px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.indexthleft2 {background-position: center top;width:100px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: right;vertical-align: middle;}
.indexthright {background-position: center top;width:104px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.indexthright2 {background-position: center top;width:104px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: right;vertical-align: middle;}
.indexthleft1 {background-position: center top;width:104px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;}
.indexthleft3 {background-position: center top;width:64px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;}
.indexthleft4 {background-position: center top;width:144px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;}
.indexthright1 {background-position: center top;width:104px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;}
.xindex {width:1047px; margin:0; padding-left:0;border-top:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 1px solid;}
.xindexdh {width:1047px; height:25px; margin:0; padding:0;}
.xindexthleft {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.xindexthleft4 {background-position: center top;width:64px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.xindexthright4 {background-position: center top;width:196px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.xindexthleft2 {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.xindexthright {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: center;vertical-align: middle;}
.xindexthright2 {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #ffffff;text-align: right;vertical-align: middle;}
.xindexthleft1 {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;}
.xindexthleft3 {background-position: center top;width:64px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;}
.xindexthright1 {background-position: center top;width:130px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;}
.xindexthright3 {background-position: center top;width:196px;height:24px;margin:0px;padding:0px;float:left;line-height:24px;background-color: #e7e7e7;text-align: center;vertical-align: middle;}
a.lj {font-size:12px; color:#ff3300; text-decoration:underline;}
a.lj:link {font-size:12px; color:#ff3300; text-decoration:underline;}
a.lj:visited {font-size:12px; color:#ff3300; text-decoration:underline;}
a.lj:hover {color:#ff3300;}
a.lj:active {color:#ff3300;}
a.lj1 {background: url(../Include/Images/bt.gif) no-repeat; width:52px; height:23px;text-align:center; padding-top:5px; font-size:12px;float:left;margin-left:5px;display:inline;}
a.lj1:link {font-size:12px; color:#000000; text-decoration:none;}
a.lj1:visited {font-size:12px; color:#000000; text-decoration:none;}
a.lj1:hover {color:#000000;}
a.lj1:active {color:#000000;}
h2 {width:1250px;padding-left:20px;padding-top:10px;margin:0; background: url(../Include/Images/menu_title.gif) repeat-x;height:21px;font-size:14px; font-weight:600;}
.input_button {width:52px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt.gif) no-repeat;}
.input_button1 {width:74px;height:23px;border:none;cursor:pointer; background:#ffffff url(../Include/Images/bt1.gif) no-repeat;}
.input_button2 {width:52px;height:23px;border:none;background:#ffffff url(../Include/Images/bt.gif) no-repeat; padding-top:5px;}
.input_button2 a{color:#000000;}
.input_button2 a:hover{color:#FF3300; text-decoration:underline;}
.input_button3 {width:95px;height:23px;border:none;background:#ffffff url(../Include/Images/bt2.gif) no-repeat;}
.input_button4 {width:143px;height:23px;border:none;background:#ffffff url(../Include/Images/bt3.gif) no-repeat;}
.z1{background-color:#e7e7e7; text-align:left; line-height:20px;}
.z2{background-color:#FFFFFF; text-align:left; line-height:20px;}
.zt1 {padding-left:10px; font-weight:600; color:#000000;}
.zt2 {padding-left:10px;}
.zt3 {text-align:center; font-weight:600; color:#000000;}
.zt4 {text-align:center; color:#000000;}
.zt5 {text-align:left; font-weight:600;}
.zt6 {font-size:14px; font-weight:600;}
.zt7 {text-align:right; color:#000000;}
.zt8 {text-align:right; color:#000000;}
.tb {width: 90%; background-color:#999999;}
.tb1 {width: 90%; background-color:#999999; margin-top:10px;}
.tb2 {width: 1050px; background-color:#999999;}
.jiacu {float:left; font-weight:bold;padding-top:5px;}
.menu_bg { background-color:#fef3bb; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cf994b 1px solid;width:1250px;clear:left;}
.menu_bg1 { background-color:#f5f5f5; padding-left:20px;padding-top:6px; padding-bottom:6px;border-bottom:#cccccc 1px solid;border-top:#cccccc 1px solid;width:100%;clear:left;}
.menu_bg2 {width:1250px;background-color:#cccccc;text-align:left;font-weight:bold;margin:10px 0 10px 0;padding-top:5px;padding-bottom:5px;border:#CCCCCC 0px solid; font-size:12px;padding-left:20px;}
.menu_bg3 {width:100%;background-color:#cccccc;text-align:left;margin:10px 0 10px 0;padding-top:5px;border:#CCCCCC 0px solid; font-size:12px;padding-left:20px;}
.ld {margin-left:20px;}
.td_left {border-left:#999999 1px solid; border-top:#999999 1px solid; border-bottom:#999999 1px solid; border-right:#999999 0px solid; font-weight:bold; background:#e7e7e7; text-align:center; line-height:22px; height:22px;}
.td_right {border-left:#999999 1px solid; border-top:#999999 1px solid; border-bottom:#999999 1px solid; border-right:#999999 1px solid; font-weight:bold; background:#e7e7e7; text-align:center; line-height:22px; height:22px;}
.td_left1 {border-left:#999999 1px solid; border-top:#999999 0px solid; border-bottom:#999999 1px solid; border-right:#999999 0px solid;  text-align:center; line-height:22px; height:22px;}
.td_right1 {border-left:#999999 1px solid; border-top:#999999 0px solid; border-bottom:#999999 1px solid; border-right:#999999 1px solid;  text-align:center; line-height:22px; height:22px;}
.td_left2 {border-left:#999999 1px solid; border-top:#999999 0px solid; border-bottom:#999999 1px solid; border-right:#999999 0px solid;  text-align:right; line-height:22px; height:22px;}
.td_right2 {border-left:#999999 1px solid; border-top:#999999 0px solid; border-bottom:#999999 1px solid; border-right:#999999 1px solid;  text-align:right; line-height:22px; height:22px;}
.td_left3 {border-left:#999999 1px solid; border-top:#999999 0px solid; border-bottom:#999999 1px solid; border-right:#999999 0px solid;  text-align:right; line-height:22px; height:22px;}
.td_right3 {border-left:#999999 1px solid; border-top:#999999 0px solid; border-bottom:#999999 1px solid; border-right:#999999 1px solid;  text-align:right; line-height:22px; height:22px;}
.bk_left {border-bottom:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 1px solid;border-top:#999999 0px solid;}
.bk_middle {border-bottom:#999999 1px solid;border-right:#999999 1px solid;border-left:#999999 0px solid;border-top:#999999 0px solid;} 
.divbackground
{
z-index:9;display:none;position:absolute;width:1120px;height:1040px;left:0px;top:0px;background-color:#8C8C8C;opacity: 0.5;filter:alpha(opacity=50,finishopacity=50,style=1);}
</style>
</head>
<body  onload="CountTotal();InitAddress();InitSelectServiceStation();">
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>        
    <div align="Justify">
     <h2>订单列表详细信息</h2>
        <div class="menu_bg">
        <asp:Button ID="btnLock" runat="server" Text="锁定" CssClass="input_button" OnClick="btnLock_Click" />
        <asp:Button ID="btnUnlock" runat="server" Text="解锁" CssClass="input_button" OnClientClick="ValidLocker()" OnClick="btnUnlock_Click" />
        <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="input_button"  OnClick="btnSave_Click" />
        <asp:Button ID="btnAudit" runat="server" Text="客服审核" CssClass="input_button1" OnClick="btnAudit_Click" OnClientClick="CheckNeedToSave()" />
        <asp:Button ID="btnAntiAudit" runat="server" Text="客服反审核" CssClass="input_button1" OnClick="btnAntiAudit_Click" />
        <asp:Button ID="btnFinancialAffairsAudit" runat="server" Text="财务审核" CssClass="input_button1" OnClick="btnFinancialAffairsAudit_Click" />
        <asp:Button ID="btnFinancialAffairsAntiAudit" runat="server" Text="财务反审核" CssClass="input_button1" OnClick="btnFinancialAffairsAntiAudit_Click" />
        <asp:Button ID="btnInvalid" runat="server" Text="作废" CssClass="input_button" OnClick="btnInvalid_Click" />
        <asp:Button ID="btnExport" runat="server" Text="导出" CssClass="input_button" OnClick="btnExport_Click" />
        <asp:Button ID="btnPrint" runat="server" Text="打印" CssClass="input_button" OnClick="btnPrint_Click" />
        <asp:Button ID="btnSuggest" runat="server" Text="意见" CssClass="input_button" OnClick="btnSuggest_Click" />
        <asp:Button ID="btnApplyForReturnPurchase" runat="server" Text="申请退货" CssClass="input_button1" OnClick="btnApplyForReturnPurchase_Click" />
        <asp:Button ID="btnCancel" runat="server" Text="取消" CssClass="input_button" OnClick="btnCancel_Click" />
        <asp:Button ID="btnReturn" runat="server" Text="返回" CssClass="input_button" OnClick="btnReturn_Click" />
        <asp:Button ID="btnSettle" runat="server" Text="结算" CssClass="input_button" OnClick="btnSettle_Click" Visible="false"/>
        <asp:Button ID="btnEditPayDetail" runat="server" Text="修改支付明细" CssClass="input_button3" OnClick="btnEditPayDetail_Click" Enabled="False" />
        <asp:Button ID="btnModifyAndClear" runat="server" Text="结算" CssClass="input_button" OnClick="btnModifyAndClear_Click"  Visible="False"/><br />
        <input type="button" id="merge" class="input_button" value="合并订单" onclick="SelectOrder('../')" />
        <asp:Button ID="btnMerge" runat="server" Width="0.1"  OnClick="btnMerge_Click" /><br />
        <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
            <ContentTemplate>--%>
            <input id="hidProduct" runat="server" type="hidden" />
            <input id="hidOrderDetailCount" runat="server" type="hidden" />
            <input id="hidCity" type="hidden" runat="server" />
            <input id="hidTotalTranerCost" runat="server" type="hidden" />
            <input id="hidCustomerId" runat="server" type="hidden" />
            <input id="hidReceiveAddressInfo" runat="server" type="hidden" />
            <input id="hidCityCode" runat="server" type="hidden" />
            <input id="hidAreaCode" runat="server" type="hidden" />
            <input id="hidSelectedPromotion" runat="server" type="hidden" />
            <input id="hidSelectedPresent" runat="server" type="hidden" />
            <input id="hidOrderMainDJBH" runat="server" type="hidden" />
            <input id="hidIsNeedToSave" runat="server" type="hidden" />
            <input id="hidServiceStationId" runat="server" type="hidden" />
            <input id="hidServiceStationName" runat="server" type="hidden" />
            <input id="hidIsUseStationDelivery" runat="server" type="hidden" />
            <input id="hidIsPayAfterReceive" runat="server" type="hidden" />
            <input id="hidIsOpenQueryStockWindow" runat="server" type="hidden" />
            <input id="hidLocker" runat="server" type="hidden" />
            <input id="hidLockerName" runat="server" type="hidden" />
            <input id="hidUser" runat="server" type="hidden" />
            <input id="hidCreator" runat="server" type="hidden" />
            <input id="hdSender" runat="server" type="hidden" />
            <input id="hidIsUnlock" runat="server" type="hidden" value="1" />
            <input id="hidpostback" runat="server" type="hidden" value="0" />
            <input id="hidFreeWL" runat="server" type="hidden" value="0" />
            <input id="hidChange" runat="server" type="hidden" value="0" />
            <asp:HiddenField ID="hdPrintFlag1" runat="server" />
            <asp:HiddenField ID="hdPrintFlag2" runat="server" />
            <asp:HiddenField ID="hdOrder" runat="server" />
            &nbsp;
            </div>
      <asp:DataList ID="dlistOrderMain" runat="server" OnItemDataBound="dlistOrderMain_ItemDataBound" Width="1017px">
                <ItemTemplate>
                <div class="juli">
                    <table style="background-color:#999999;" border="0" cellspacing="1" cellpadding="0">
                        <tr class="z2">
                            <td class="zt5" width="120">
                                订单编号：
<input type="hidden" id="orderCode" value='<%# Eval("ORDER_ID")%>'/> 

                            </td>
                            <td width="260">
                                <%# Eval("ORDER_ID")%>
                            </td>
                            <td class="zt5" width="120">
                                下单日期：

                            </td>
                            <td>
                                <%# Eval("ORDER_CREATEDATE")%>
                            </td>

                        </tr>
                        <tr class="z2">
                            <td class="zt5" width="120">
                                关联订单：

                            </td>
                            <td>
                                <a class="lj" href='../Order/OrderDetail.aspx?code=<%# Eval("ORDER_AID")%>'><%# Eval("ORDER_AID")%></a>
                            </td>
                            <td class="zt5">
                                锁定：

                            </td>
                            <td>
                                <asp:CheckBox ID="chkLock" runat="server" Enabled="false" Checked='<%# Eval("ORDER_LOCK").ToString()!="0"?true:false%>' />
                            </td>
                        </tr>
                        <tr class="z2">
                            <td class="zt5" width="120">
                                会员代码：

                            </td>
                            <td>
                                <asp:Label ID="lblCustomerCode" runat="server" Text='<%# Eval("CustomerCode")%>' Visible="false"></asp:Label>
                                <input id="usercode" type="hidden" value='<%# Eval("CustomerCode")%>' />
                                <a class="lj"  onclick="window.open('../CustomerArchives/CustomerArchiveEdit.aspx?code=<%# Eval("CustomerCode")%>')" href= 'javascript:'><%# Eval("CustomerCode")%></a>
                            </td>
                            <td class="zt5">
                               锁定人

                            </td>
                            <td>
                                <%# Eval("Locker")%>
                            </td> 

                        </tr>
                        <tr id="Tr2" class="z2" runat="server">
                            <td class="zt5">
                                 用户昵称   

                            </td>
                            <td>
                                <%# Eval("BYZD5")%>
                            </td>
                            <td class="zt5">
                                制单人

                            </td>
                            <td>
                                <%# Eval("CREATOR")%>
                            </td>

                        </tr>
                        <tr class="z2">
                            <td class="zt5" width="120">
                                会员名称：

                            </td>
                            <td>
                                <%# Eval("CustomerName")%>
                            </td>
                            <td class="zt5">
                                锁定日期：

                            </td>
                            <td>
                                <%# Eval("ORDER_LOCKDATE")%>
                            </td>

                        </tr>
                        <tr class="z2">
                            <td class="zt5" width="120">
                                订单来源：

                            </td>
                            <td>
                                <input id="hidOrderSource" runat="server" type="hidden" value='<%# Eval("ORDER_OFCODE")%>' />
                                <asp:DropDownList ID="dropOrderSource" runat="server">
                                </asp:DropDownList>
                            </td>
                            <td class="zt5">
                                 作废：

                            </td>
                            <td>
                               <asp:CheckBox ID="chkDelete" runat="server" Enabled="false" Checked='<%# Eval("ORDER_DELETE").ToString()!="0"?true:false%>' />
                            </td>



                        </tr>
                        <tr class="z2">
                            <td class="zt5" width="120">
                                货到付款：

                            </td>
                            <td>
                                <input id="hidPayAfterReceive" runat="server" type="hidden" value='<%# Eval("ORDER_APAY")%>' />
                                <asp:DropDownList ID="dropPayAfterReceive" runat="server" Enabled="false">
                                    <asp:ListItem Text="货到付款" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="非货到付款" Value="0"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="zt5">
                                作废人

                            </td>
                            <td>
                               <%# Eval("Deleter")%>
                            </td>

                        </tr>
                        <tr class="z2">
                            <td class="zt5" width="120">
                                配送方式：
                            </td>
                            <td>
                                <input id="hidTraner" runat="server" type="hidden" value='<%# Eval("ORDER_TRANERCODE")%>' />
                                <asp:DropDownList ID="dropTraner" runat="server" onchange="CountTotal('1')">
                                </asp:DropDownList>
                            </td>
                            <td class="zt5">
                                作废日期：

                            </td>
                            <td>
                                <%# Eval("ORDER_DELETEDATE")%>
                            </td>


                        </tr>
                        <tr class="z2">
                            <td class="zt5">
                                费用性质：

                            </td>
                            <td>
                                <input id="hidCostNature" runat="server" type="hidden" value='<%# Eval("ORDER_COSTNATURE")%>' />
                                <asp:DropDownList ID="dropCostNature" runat="server" Enabled="false">
                                    <asp:ListItem Text="买家承担" Value="002"></asp:ListItem>
                                    <asp:ListItem Text="卖家承担" Value="001"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td class="zt5">
                                客审：

                            </td>
                            <td>
                                <asp:CheckBox ID="chkAudit" runat="server" Enabled="false" Checked='<%# Eval("ORDER_CHECK").ToString()!="0"?true:false%>' />
                            </td>


                        </tr>
                        
                        <tr class="z2">
                            <td class="zt5">
                                商品数量：

                            </td>
                            <td>
                                <asp:Label ID="lblQuantity" runat="server" Text='<%# Eval("ORDER_QTY")%>'></asp:Label>
                            </td>
                            <td class="zt5">
                                客审人

                            </td>
                            <td>
                                <%# Eval("Checker")%>
                            </td> 


                        </tr>
                        <tr class="z2">
                            <td class="zt5" width="120">
                                商品金额：

                            </td>
                            <td>
                                
                                <asp:Label ID="lblAmt" runat="server" Text='<%# String.Format("{0:0.00}", Eval("ORDER_AMT"))%>'></asp:Label>
                            </td>
                            <td class="zt5">
                                客审日期：

                            </td>
                            <td>
                                <%# Eval("ORDER_CHECKDATE")%>
                            </td>
                         
                        </tr>
                        <tr class="z2">
                            <td class="zt5" width="120">
                                让利金额：

                            </td>
                            <td>
                                <asp:TextBox ID="txtOfferAmt" runat="server" Text='<%# String.Format("{0:0.00}", Eval("ORDER_OFFERAMT"))%>' onkeyup="CountTotal('1')"></asp:TextBox>
                            </td>
                            <td class="zt5">
                                财审：

                            </td>
                            <td>
                                <asp:CheckBox ID="chkFinancialAffairsAudit" runat="server" Enabled="false" Checked='<%# Eval("ORDER_ACHECK").ToString()!="0"?true:false%>' />
                            </td>

                        </tr>
                        <tr class="z2">
                            <td class="zt5">
                                物流费用：

                            </td>
                            <td>
                                <asp:TextBox ID="txtTranCost" runat="server" Text='<%# String.Format("{0:0.00}", Eval("ORDER_TRANCOST"))%>' onkeyup="EditTranCostUpdateAamt()"></asp:TextBox>
                            </td>
                            <td class="zt5">
                                财审人

                            </td>
                            <td>
                                <%# Eval("Achecker")%>
                            </td>
 
                        </tr>
                        <tr class="z2">
                            <td class="zt5">
                                实际金额：

                            </td>
                            <td>
                                <asp:Label ID="lblAamt" runat="server" Text='<%# String.Format("{0:0.00}", Eval("ORDER_AAMT"))%>'></asp:Label>
                            </td>
                            <td class="zt5">
                                财审日期：

                            </td>
                            <td>
                                <%# Eval("ORDER_ACHECKDATE")%>
                            </td> 
                        </tr>
                        <tr class="z2">
                            <td class="zt5">
                                索要发票：

                            </td>
                            <td>
                                <asp:CheckBox ID="chkNINV" runat="server" Checked='<%# Eval("ORDER_NINV").ToString()!="0"?true:false%>' />
                                <asp:TextBox ID="txtINVTITLE" runat="server" Text='<%# Eval("ORDER_INVTITLE")%>'></asp:TextBox>
                            </td>
                            <td class="zt5">
                                发货：

                            </td>
                            <td>
                                <asp:CheckBox ID="chkDeliver" runat="server" Enabled="false" Checked='<%# Eval("ORDER_SEND").ToString()!="0"?true:false%>' />
                            </td> 

                        </tr>
                        <tr class="z2">
                            <td class="zt5">
                                担保交易：

                            </td>
                            <td>
                                <asp:CheckBox ID="chkSecDeal" runat="server" Enabled="false" Checked='<%# Eval("ORDER_SECDEAL").ToString()!="0"?true:false%>' />
                            </td>
                            <td class="zt5">
                                发货日期：

                            </td>
                            <td>
                                <%# Eval("ORDER_SENDDATE")%>
                            </td>                   

                        </tr>
                        <tr class="z2">
                             <td class="zt5">
                                结算：

                            </td>
                            <td>
                                <asp:CheckBox ID="chkClear" runat="server" Enabled="false" Checked='<%# Eval("ORDER_CLEAR").ToString()!="0"?true:false%>' />
                            </td>                                          
                            <td class="zt5">
                                重量：

                            </td>
                            <td>
                                <asp:Label ID="lblWeight" runat="server" Text='<%# Eval("ORDER_WEIGHT")%>'></asp:Label>
                            </td>
                        </tr>
                        <tr class="z2">
                            <td class="zt5">
                                已结算金额：
                            </td>
                            <td>
                               <%# String.Format("{0:0.00}", Eval("ORDER_CLEARAMT"))%>
                            </td>
                            <td class="zt5">
                                发货人：

                            </td>
                            <td>
                                <%# Eval("SENDER")%>
                            </td>

                        </tr>
                        <tr id="source" class="z2" runat="server">
                            <td class="zt5">
                                渠道：

                            </td>
                            <td>
                               <%-- <%# Eval("ORDER_FIELD1")%>--%>
                            </td>
                            <td class="zt5">
                                促销
                            </td>
                            <td>
                                <asp:CheckBox ID="CheckBox9" runat="server" Checked=' <%# Eval("ORDER_IsPromotion").ToString()!="0"?true:false%>' Enabled="False" />
                            </td>

                        </tr>
                        <tr class="z2">
                            <td class="zt5">
                                备注：

                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtNote" runat="server" Text='<%# Eval("ORDER_NOTE")%>'></asp:TextBox>
                            </td></tr>
                        <tr class="z2">
                            <td class="zt5">
                                客户要求：

                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="txtKUYQ" runat="server" Text='<%# Eval("BYZD19")%>'  ReadOnly="true"></asp:TextBox>
                            </td></tr>
                    </table></div>
                </ItemTemplate>
            </asp:DataList><br />
        
            
            <div class="juli">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                    <div class="menu_bg2">商品明细&nbsp;<asp:Button ID="btnAddProduct" runat="server" Text="新增" CssClass="input_button" OnClientClick="SearchProduct('../');" OnClick="btnAddProduct_Click" /></div>
                        <asp:DataList ID="dlistOrderDetail" runat="server" Width="100%" OnItemDataBound="dlistOrderDetail_ItemDataBound" OnItemCommand="dlistOrderDetail_ItemCommand">
                        <HeaderTemplate>
                            <tr>
                                <td class="td_left" width=5%>
                                    删除</td>
                                <td class="td_left" width=30%>
                                    代码名称</td>
                                <td class="td_left" width=5%>
                                    颜色</td>
                                
                                <td class="td_left" width=5%>
                                    尺码</td>
                                <td class="td_left" width=5%>
                                    数量</td>
                                <td class="td_left" width=7%>
                                    标准单价</td>
                                <td class="td_left" width=5%>
                                    折扣</td>
                                <td class="td_left" width=7%>
                                    实际单价</td>
                                <td class="td_left" width=7%>
                                    标准金额</td>
                                <td class="td_left" width=7%>
                                    实际金额</td>
                                <td class="td_right" width=7%>
                                    重量</td>                                    
                                <td id="PromoteSalesColumn" class="td_right" width=10% runat="server">
                                    促销活动
                                </td>
                                <td class="td_right" width=7%>
                                    显示库存
                                </td>
                            </tr>                           
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td class="td_left1" width=5%>
                                    <asp:Button ID="btnDelete" runat="server" CssClass="input_button" CommandName="del" Text="删除" />
                                </td>                            
                                <td class="td_left1" width=30%>                                    
                                    <asp:Label ID="lblCode" runat="server" Text='<%# Eval("od_cmdcode")%>'></asp:Label>&nbsp;
                                    <asp:Label ID="lblName" runat="server" Text='<%# Eval("spmc")%>'></asp:Label>
                                    <asp:Label ID="lblPreferentialMode" runat="server" ForeColor="red"></asp:Label>
                                    <asp:Label ID="lblIsPresent" runat="server" ForeColor="red"></asp:Label>
                                    <input id="hidDetailId" runat="server" type="hidden" value='<%# Eval("od_detailid") %>'/>
                                </td>
                                <td class="td_left1" width=5%>
                                    <input id="hidColor" runat="server" type="hidden" value='<%# Eval("od_colorcode") %>'/>
                                    <asp:DropDownList ID="dropColor" runat="server" AutoPostBack="true" OnSelectedIndexChanged="dilstOrderDetail_DDLCHANGE_Click" AppendDataBoundItems="true">
                                    <asp:ListItem Value="-1" Text=""></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td class="td_left1" width=5%>
                                    <input id="hidSize" runat="server" type="hidden" value='<%# Eval("od_sizecode") %>' />
                                    <asp:DropDownList ID="dropSize" runat="server" AppendDataBoundItems="true">
                                    <asp:ListItem Value="-1" Text=""></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                                <td class="td_left1" width=5%>
                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="zt8" Text='<%# Eval("od_qty") %>' Width="50" onkeyup="CountTotal('1')"></asp:TextBox></td>
                                <td class="td_left2" width=7%>
                                    <asp:Label ID="lblSprice" runat="server" Text='<%# String.Format("{0:0.00}", Eval("od_sprice")) %>'></asp:Label>
                                    <input id="hidSprice" type="hidden" runat="server" value='<%# Eval("od_sprice") %>' />
                                </td>
                                <td class="td_left1" width=5%>
                                    <asp:TextBox ID="txtDiscount" runat="server" Text='<%# Eval("od_disc") %>' Width="50" onblur="CountTotal('1')"></asp:TextBox></td>
                                <td class="td_left2" width=7%>
                                    <asp:Label ID="lblAprice" runat="server" Text='<%# Eval("od_aprice") %>'></asp:Label>
                                    <input id="hidAprice" type="hidden" runat="server" value='<%# Eval("od_aprice") %>'/>
                                </td>
                                <td class="td_left2" width=7%>
                                    <asp:Label ID="lblSamt" runat="server" Text='<%# Eval("od_samt") %>'></asp:Label>
                                </td>
                                <td class="td_left2" width=7%>
                                    <asp:Label ID="lblAamt" runat="server" Text='<%# Eval("od_aamt") %>'></asp:Label>
                                </td>
                                <td class="td_left2" width=7%>
                                    <asp:Label ID="lblWeight" runat="server" Text='<%# String.Format("{0:0}", Convert.ToDecimal(Eval("OD_WEIGHT"))*Convert.ToDecimal(Eval("od_qty"))) %>'></asp:Label>
                                    <input id="hidWeight" runat="Server" type="hidden" value='<%# Eval("OD_WEIGHT")%>' />
                                </td>
                                <td runat="server" id="PromoteSalesColumn" class="td_left2" width=10%>
                                    <asp:Button ID="btnPromotionSales" runat="server" CssClass="input_button1" Text="促销活动" CommandName="PromotionSales"  OnClientClick='SelectPromotion(this)' />
                                    <asp:Button ID="btnSelectPresent" runat="server" CssClass="input_button1" Text="选择礼品" Visible="false" CommandName="SelectPresent" OnClientClick='SelectPresent(this)' />
                                    <input id="hidIsPresent" runat="server" type="hidden" value='<%# Eval("OD_FIELD2") %>' />
                                    <input id="hidPresentSource" runat="server" type="hidden" value='<%# Eval("OD_FIELD1") %>' />
                                    <input id="hidPreferentialMode" runat="server" type="hidden" value='<%# Eval("OD_OFFERNO") %>' />
                                    <input id="hidPromotionId" runat="server" type="hidden" value='<%# Eval("OD_OFFERID") %>' />
                                    <input id="hidPromotionOffAmt" runat="server" type="hidden" value='<%# Eval("PromotionOffAmt") %>' />
                                    <input id="hidPromotionIsUseCustomerDiscount" runat="server" type="hidden" value='<%# Eval("PromotionIsUseCustomerDiscount") %>' />
                                    &nbsp;
                                </td>
                                <td class="td_right2" width=7%>
                                    <input id="btnQueryStock" type="button" class="input_button1" value="查看库存" name='<%# Eval("od_cmdcode")%>' onclick="QueryStock(this)" />
                                </td>
                            </tr>                            
                        </ItemTemplate>
                    </asp:DataList>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
                <br />
        <div class="juli"><asp:DataList ID="dlistReceiveAddress" runat="server" CellPadding="0">
            <HeaderTemplate>
                <table class="tb2" border="0" cellspacing="1" cellpadding="0">
                    <tr class="z1">
                        <td class="zt3" width="80">
                            选择地址
                        </td>
                        <td class="zt3" width="100">
                            收货人

                        </td>
                        <td class="zt3" width="280">
                            所在地区

                        </td>
                        <td class="zt3" width="280">
                            街道地址
                        </td>
                        <td class="zt3" width="100">
                            邮编
                        </td>
                        <td class="zt3">
                            联系电话
                        </td>
                        
                    </tr>
                </table>
            </HeaderTemplate>
            <ItemTemplate>
                <table width="1050" border="0" cellspacing="0" cellpadding="0">
                    <tr style="line-height:22px;">
                        <td align="center" class="bk_left" width="80">
                          
                            <input id="btnInItem" type="button" value="选择" class="input_button" name="InItem" lang='<%# Eval("Receiver") + "$" + Eval("ProvinceCode") + "$" + Eval("CityCode") + "$" + Eval("AreaCode") + "$" + Eval("Address") + "$" + Eval("PostDM") + "$" + Eval("Tel") + "$" + Eval("Mobile")%>' onclick="AddressSelect(this)" />
                        </td>
                        <td width="100" align="center" class="bk_middle">
                            &nbsp;<asp:Label ID="lblCustomerName" runat="server" Text='<%# Eval("Receiver")%>'></asp:Label>    
                        </td>
                        <td width="280" align="center" class="bk_middle">
                            <input id="hidProvinceCode" type="hidden" runat="server" value='<%# Eval("ProvinceCode")%>' />
                            <input id="hidCityCode" type="hidden" runat="server" value='<%# Eval("CityCode")%>' />
                            <input id="hidAreaCode" type="hidden" runat="server" value='<%# Eval("AreaCode")%>' />
                            <asp:Label ID="lblProvince" runat="server" Text='<%# Eval("ProvinceName")%>'></asp:Label>&nbsp;
                            <asp:Label ID="lblCity" runat="server" Text='<%# Eval("CityName")%>'></asp:Label>&nbsp;
                            <asp:Label ID="lblArea" runat="server" Text='<%# Eval("AreaName")%>'></asp:Label>
                        </td>
                        <td width="280" align="center" class="bk_middle">
                            <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("Address")%>'></asp:Label>
                        </td>
                        <td width="100" align="center" class="bk_middle">
                            <asp:Label ID="lblPostCode" runat="server" Text='<%# Eval("PostDM")%>'></asp:Label>
                        </td>
                        <td align="center" class="bk_middle">
                            <asp:Label ID="lblPhone" runat="server" Text='<%# Eval("Tel")%>'></asp:Label>
                            <asp:Label ID="lblMobile" runat="server" Text='<%# Eval("Mobile")%>'></asp:Label>
                        </td>
                        
                    </tr>
                </table>      
            </ItemTemplate>
            <%--<FooterTemplate>
                <table width="1050" border="0" cellspacing="0" cellpadding="0">
                    <tr style="line-height:22px;">
                        <td align="center" class="bk_left" width="30">
                            <input id="rdoInFooter" name="InFooter" type="radio" value="InFooter" onclick="RadioButtonClick(this)" />
                        </td>
                        <td align="left" class="bk_middle">
                            使用其他地址
                        </td>
                        
                    </tr>
                </table>
            </FooterTemplate>--%>
        </asp:DataList></div>
        <div class="juli">
            <asp:Panel ID="pnlSendInfo" runat="server" Height="150px" Width="400px">
            
            　收货人：<input id="txtReceiver" runat="server" type="text" /><br />
            　　地区：<select id="Province" runat="server" onchange="GetCityList(this.value)">                 
            </select>
            省

            <select id="City" runat="server" onchange="GetAreaListAndCountTotal(this.value)">
            </select>
            市

            <select id="Area" runat="server" onchange="SetAreaCode()">
            </select>
            区<br />
            街道地址：<input id="txtAddress" style="width:330px;" runat="server" type="text" /><br />
            邮政编码：<input id="txtPostCode" runat="server" type="text" /><br />
            联系电话：<input id="txtPhone" runat="server" type="text" value="区号" size="8"  onfocus="Clear(this)" />
                    <input id="txtPhone1" runat="server" type="text" value="号码" size="14"  onfocus="Clear(this)" />
                    <input id="txtPhone2" runat="server" type="text" value="分机" size="14" onfocus="Clear(this)" /><br />
            　　手机：<input id="txtMobile" runat="server" type="text" />
           </asp:Panel>
                <div align="center"><input id="addAddress" type="button" value="加入地址" onclick="AddNewAddress()"/></div>
            <br />
            <asp:Panel ID="pnlServiceStation" runat="server" Height="101px" Width="400px">
                服务站编号：<asp:Label ID="lblServiceStationId" runat="server"></asp:Label>
                <br />
                服务站名称：<asp:Label ID="lblServiceStationName" runat="server"></asp:Label><br />
                代收款：<asp:CheckBox ID="chk1" runat="server" Enabled="false" /><br />
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                <a href="#" onclick="SelectServiceStation()">选择送货服务站</a>&nbsp; &nbsp;
                <a href="#" onclick="CancelSelectServiceStation()">取消服务站送货</a>
                
                </asp:Panel>
        </div>
     <%-- <asp:UpdatePanel ID="UpdatePanel5" runat="server">
        <ContentTemplate>--%>
            <div class="juli">
                &nbsp;</div> 
        <%--</ContentTemplate>
        </asp:UpdatePanel>--%>
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
        <div class="menu_bg2">
        
        支付明细&nbsp;<asp:Button ID="btnAddPayDetail" runat="server" Text="新增" CssClass="input_button" OnClick="btnAddPayDetail_Click" /></div>
            <asp:DataList ID="dlistPayDocPayDetail" runat="server" OnItemDataBound="dlistPayDocPayDetail_ItemDataBound" OnItemCommand="dlistPayDocPayDetail_ItemCommand" CellPadding="0" ShowFooter="true" >
            <HeaderTemplate>
                <table width="1250" border="0" cellspacing="0" cellpadding="0" id="ZFDetail">
                    <tr>
                        <td class="td_left" width=60>
                            删除
                        </td>
                        <td class="td_left" width=130>
                            帐号
                        </td>
                        <td class="td_left" width=60>
                            交易类型
                        </td>
                        <td class="td_left" width=130>
                            支付方式
                        </td>
                        <td class="td_left" width=80>
                            支付金额
                        </td>
                        <td class="td_left" width=130>
                            支付日期
                        </td>
                        <td class="td_left" width=130>
                            交易号


                        </td>
                        <td class="td_left" width=130>
                            交易日期
                        </td>
                        <td class="td_left">
                            备注
                        </td>
                        <td class="td_left" width=60>
                            到帐金额
                        </td>
                        <td class="td_left" width=130>
                            到帐日期
                        </td>
                        <td class="td_right" width=80>
                            已退货金额

                        </td>                
                    </tr>     
            </HeaderTemplate>
            <ItemTemplate>    
                    <tr>
                        <td class="td_left1" width=60>
                            <asp:Button ID="btnDelete" CssClass="input_button" runat="server" Text="删除" CommandName="Del" />
                        </td>
                        <td class="td_left1" width=130>
                            <%--<asp:TextBox ID="txtAccount" CssClass="kuandu2" Width="120" runat="server" Text='<%# Eval("PD_ACCOUNT")%>'></asp:TextBox>--%>
                            <asp:Label ID="lblAccount" CssClass="kuandu2" Width="120" runat="server" Text='<%# Eval("PD_ACCOUNT")%>'></asp:Label>
                        </td>
                        <td class="td_left1" width=60>
                            <asp:DropDownList ID="dropDealType" runat="server" Width="55"  AutoPostBack="true" OnSelectedIndexChanged="DataList2_DDLCHANGE_Click">
                            <asp:ListItem Text="即时到帐" Value="001"></asp:ListItem>
                            <asp:ListItem Text="担保交易" Value="002"></asp:ListItem>
                            <asp:ListItem Text="结余款" Value="003"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td class="td_left1" width=130>
                            <asp:DropDownList ID="dropPayType" Width="105" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DataList2_DDLDROPCHANGE_Click">
                            </asp:DropDownList>
                        </td>
                        <td  class="td_left1" width=80>
                            <asp:TextBox ID="txtPayAmount" CssClass="zt7" Width="60" runat="server" Text='<%# Eval("PD_PAYAMT")%>' onchange='addZF()'></asp:TextBox>
                        </td>
                        <td class="td_left1" width=130>
                            <asp:TextBox ID="txtPayDate" CssClass="kuandu2" Width="114" runat="server" Text='<%# Eval("PD_PAYDATE")%>' OnClick="setday(this)" ></asp:TextBox>
                        </td>
                        <td class="td_left1" width=130>
                            <asp:TextBox ID="txtDealID" CssClass="kuandu2" Width="120" runat="server" Text='<%# Eval("PD_DEALID")%>' onkeyup="CheckDigit(this,'交易号只能是数字')"></asp:TextBox>
                        </td>
                        <td class="td_left1" width=130>
                            <%--<asp:TextBox ID="txtDealDate" CssClass="kuandu2" Width="114" runat="server" Text='<%# Convert.ToDateTime(Eval("PD_DEALDATE")).ToShortDateString()%>' OnClick="setday(this)"></asp:TextBox>--%>
                            <asp:TextBox ID="txtDealDate" CssClass="kuandu2" Width="114" runat="server" Text='<%# Eval("PD_DEALDATE")%>' OnClick="setday(this)"></asp:TextBox>
                        </td>
                        <td class="td_left1">
                            <asp:TextBox ID="txtNotes" CssClass="kuandu3" Width="100" runat="server" Text='<%# Eval("PD_NOTE")%>'></asp:TextBox>
                        </td>
                        <td class="td_left3" width=60>
                           <asp:Label ID="lblGetAmt" runat="server" Text=' <%# String.Format("{0:0.00}", Eval("PD_GETAMT"))%>'></asp:Label>
                        </td>
                        <td class="td_left1" width=130>
                            <asp:Label ID="lblGetDate" runat="server" Text='<%# Eval("PD_GETDATE")%>'></asp:Label>&nbsp;
                        </td>
                        <td class="td_right3" width=80>
                            <asp:Label ID="lblHRAmt" runat="server" Text='<%# String.Format("{0:0.00}", Eval("PD_HRAMT"))%>'></asp:Label>
                        </td>  
                    </tr>        
            </ItemTemplate>
            <FooterTemplate>   
                    <tr>
                        <td class="td_left1" width="60">
                        <asp:Label ID="c1" runat="server" Text="总计"></asp:Label>
                        </td>
                        <td class="td_left1" width="130">
                        <asp:Label ID="c2" runat="server" Text="--"></asp:Label>
                        </td>
                        <td class="td_left1" width="60">
                        <asp:Label ID="c3" runat="server" Text="--"></asp:Label>
                        </td>
                        <td class="td_left1" width="130">
                        <asp:Label ID="c4" runat="server" Text="--"></asp:Label>
                        </td>
                        <td  class="td_left1" width="80">
                        <input id="c5" type="text" runat="server" value="0" readonly="readonly"/>
                        </td>
                        <td class="td_left1" width="130">
                        <asp:Label ID="c6" runat="server" Text="--"></asp:Label>
                        </td>
                        <td class="td_left1" width="130">
                        <asp:Label ID="c7" runat="server" Text="--"></asp:Label>
                        </td>
                        <td class="td_left1" width="130">
                        <asp:Label ID="c8" runat="server" Text="--"></asp:Label>
                        </td>
                        <td class="td_left1">
                        <asp:Label ID="c9" runat="server" Text="--"></asp:Label>
                        </td>
                        <td class="td_left3" width="60">
                        <asp:Label ID="c10" runat="server" Text="--"></asp:Label>
                        </td>
                        <td class="td_left1" width="130">
                        <asp:Label ID="c11" runat="server" Text="--"></asp:Label>
                        </td>
                        <td class="td_right3" width="80">
                        <asp:Label ID="c12" runat="server" Text="--"></asp:Label>
                        </td>  
                    </tr>        
            </table>
            </FooterTemplate>
        </asp:DataList>
            </ContentTemplate>
        </asp:UpdatePanel>
        <div class="menu_bg2"><span class="jiacu">礼券支付</span></div>
        <div class="juli">
        <asp:DataList ID="dlistCoupon" runat="server" CellPadding="0">
            <HeaderTemplate>
                <table class="tb3" border="0" cellpadding="0" cellspacing="1">
                    <tr class="z1">
                        <td>
                        
                        </td>
                        <td class="zt3">
                            礼券号

                        </td>
                        <td class="zt3">
                            礼券面值

                        </td>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                    <tr class="z2">
                        <td class="zt4">
                            <asp:CheckBox ID="chkCoupon" runat="server" Checked=' <%# Convert.ToString(Eval("Frozen"))=="1"?true:false %>' />
                        </td>
                        <td class="zt4">
                             
                            <asp:Label ID="lblCouponCode" runat="server" Text='<%# Eval("CouponCode")%>'></asp:Label>
                        </td>
                        <td class="zt4">
                             
                            <asp:Label ID="lblCouponAmount" runat="server" Text='<%# Eval("XFJE")%>'></asp:Label>
                        </td>
                    </tr>
            </ItemTemplate>
            <FooterTemplate>
             </table>
            </FooterTemplate>
        </asp:DataList>
        </div>
        
                        <div class="menu_bg2"><span class="jiacu">意见详细信息</span>&nbsp;<asp:Button ID="btnAddSuggestion" CssClass="input_button" runat="server" Text="意见" OnClick="btnAddSuggestion_Click" /></div>
                <div class="juli"><uc1:ORDERNOTEListControl ID="ORDERNOTEListControl1" runat="server" />
                </div>       
           <%-- </ContentTemplate>
        </asp:UpdatePanel>--%>
        
        <asp:Button runat="server" ID="hiddenTargetControlForModalPopup" style="display:none"/>
        <cc1:ModalPopupExtender runat="server" ID="programmaticModalPopup"
            PopupControlID="programmaticPopup"
            BackgroundCssClass="modalBackground"
            TargetControlID="hiddenTargetControlForModalPopup">
        </cc1:ModalPopupExtender>
        <asp:Panel runat="server" CssClass="modalPopup" ID="programmaticPopup" style="display:none;width:350px;padding:10px">
            以下商品可用库存不足，是否审批订单?<br />
            <asp:Panel runat="Server" ID="programmaticPopupDragHandle" Style="cursor: move;background-color:#fef3bb;border:solid 1px #cf994b;color:Black;text-align:center; line-height:22px; font-weight:600;" ScrollBars="Auto" Height="300px">
                
               <%-- <asp:Label ID="lblProducts" runat="server"></asp:Label>--%>
               <div id="Products" runat="server"></div>
               
            </asp:Panel>
            <div style="text-align:center; margin-top:10px;"><asp:Button ID="btnSubmit" runat="server" CssClass="input_button" Text="确定" OnClick="btnSubmit_Click" />  
            <asp:Button ID="btnCancelAudit" runat="server" CssClass="input_button" Text="取消" OnClick="btnCancelAudit_Click" /></div>  
        </asp:Panel><br /><br />
    </div>
    <div id="div_background">
            </div>
           
    </form>
</body>
</html>
